package com.kyjszj.modules.view.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.kyjszj.core.query.data.Queryable;
import com.kyjszj.modules.product.entity.Product;
import com.kyjszj.modules.product.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 开源技术之家
 */

@Controller
@RequestMapping("${default.url.prefix}/")
public class AdminIndexController {

    @Autowired
    private IProductService productService;
    @RequestMapping("/index")
    public String index(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap){
        Page<Product> products=productService.selectPage(new Page<Product>());
        modelMap.put("products",products.getRecords());
        return "/f/index";
    }
}
